Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support displaying online hosts in "SHOW HOSTS" command and save hosts info in rocskdb #450

Merged
merged 5 commits into from
Jun 12, 2019

Conversation

critical27
Copy link
Contributor

as title #440

@critical27 critical27 added the ready-for-testing PR: ready for the CI test label May 28, 2019
@critical27 critical27 requested review from dangleptr and ayyt May 28, 2019 07:29
@dangleptr
Copy link
Contributor

You could run UTs locally with ctest, and the failure could be check on http://ci.vesoft.com/job/Nebula-Graph-UnitTest/

@dangleptr
Copy link
Contributor

Close #440

@critical27 critical27 added in progress ready-for-testing PR: ready for the CI test and removed ready-for-testing PR: ready for the CI test in progress labels May 28, 2019
@critical27
Copy link
Contributor Author

jenkins go

@critical27 critical27 requested a review from laura-ding May 28, 2019 09:27
@nebula-community-bot
Copy link
Member

Unit testing passed.

@dangleptr
Copy link
Contributor

Please rebased on master

@dangleptr dangleptr requested a review from darionyaphet May 29, 2019 10:19
std::vector<uniform_tuple_t<std::string, 2>> expected{
{"127.0.0.1", "1000"},
{"127.0.0.1", "1100"},
std::vector<uniform_tuple_t<std::string, 3>> expected{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better test one case with host offline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roger that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SchemaTest has other ut which need to use active hosts. I add ut in meta/test/ProcessorTest.

const auto& prefix = MetaServiceUtils::hostPrefix();
std::unique_ptr<kvstore::KVIterator> iter;
auto ret = kvstore_->prefix(kDefaultSpaceId_, kDefaultPartId_, prefix, &iter);
if (ret != kvstore::ResultCode::SUCCEEDED) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If whitelist disabled, no hosts existed in rocksdb is normal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@critical27
Copy link
Contributor Author

jenkins go

@nebula-community-bot
Copy link
Member

Unit testing passed.

dutor
dutor previously approved these changes May 30, 2019
Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean code.

@critical27 critical27 requested a review from dangleptr May 30, 2019 05:33
@critical27
Copy link
Contributor Author

jenkins go

@nebula-community-bot
Copy link
Member

Unit testing passed.

1 similar comment
@nebula-community-bot
Copy link
Member

Unit testing passed.

@@ -89,6 +89,11 @@ struct EdgeItem {
4: common.Schema schema,
}

struct HostItem {
1: common.HostAddr hostAddr,
2: string status,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better use one enum class to represent status.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

/**
* Get all hosts with online/offline status.
* */
StatusOr<std::vector<cpp2::HostItem>> allHostsWithStatus();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better put the method in ListHostProcessor if no other processors use it.

@nebula-community-bot
Copy link
Member

Unit testing failed.

@critical27
Copy link
Contributor Author

jenkins go

@critical27 critical27 requested a review from dangleptr May 30, 2019 09:56
@critical27
Copy link
Contributor Author

Jenkins go

@nebula-community-bot
Copy link
Member

Unit testing failed.

@critical27
Copy link
Contributor Author

Jenkins go!

Copy link
Contributor

@dangleptr dangleptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr looks better now.

@@ -23,6 +23,9 @@ namespace meta {

using nebula::network::NetworkUtils;

const PartitionID kDefaultPartId_ = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it some where more common, use "static const" and remove the underscore in name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some processors only depends on this header file, I will rename it anyway.

@nebula-community-bot
Copy link
Member

Unit testing failed.

1 similar comment
@nebula-community-bot
Copy link
Member

Unit testing failed.

@critical27
Copy link
Contributor Author

Jenkins go

@nebula-community-bot
Copy link
Member

Unit testing failed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing failed.

1 similar comment
@nebula-community-bot
Copy link
Member

Unit testing failed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

1 similar comment
@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

Copy link
Contributor

@dangleptr dangleptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. LGTM now

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dangleptr dangleptr merged commit 8a3735a into vesoft-inc:master Jun 12, 2019
@critical27 critical27 deleted the host branch June 12, 2019 07:50
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
…s info in rocskdb (vesoft-inc#450)

* Support displaying online hosts in "SHOW HOSTS" command [440]

* remove ActivHostsManHolder, store host info in rocksdb

* Use call_once to init ActiveHostsMan.
Rebased on master.
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
…s info in rocskdb (vesoft-inc#450)

* Support displaying online hosts in "SHOW HOSTS" command [440]

* remove ActivHostsManHolder, store host info in rocksdb

* Use call_once to init ActiveHostsMan.
Rebased on master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants